<%-- 
    Document   : nuevoMedico
    Created on : 01-jul-2012, 16:26:23
    Author     : Mariita
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="Unit.*" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="CSS/style.css" />
        <title>JSP Page</title>
    </head>
    <body>
          <div id="main_container">
  <div class="header">
    <div id="logo"><a href="Info.jsp"><img src="images/logo.png" alt="" width="162" height="54" border="0" /></a></div>
    <div class="right_header">
      <div class="top_menu"> <a href="Info.jsp" class="login">login</a> <a href="Inicio.jsp" class="sign_up">signup</a> </div>
      <div id="menu">
        <ul>
          <%
    
String usu=application.getAttribute("usuario").toString();          
if(usu.equalsIgnoreCase("admin"))
{
%>
          <li><a class="current" href="nuevoMedico.jsp">Administrador</a></li>
          <li><a href="Medicina.jsp">Medico</a></li>
          <li><a href="Info.jsp">Servicios</a></li>
          <li><a href="Info.jsp">Paciente</a></li>
<%}%>

          <%        
if(usu.equalsIgnoreCase("medico"))
{
%>
          <li><a class="current" href="Medicina.jsp">Medico</a></li>
          <li><a href="Info.jsp">Servicios</a></li>
          <li><a href="Info.jsp">Paciente</a></li>
<%}%>

          <%        
if(usu.equalsIgnoreCase("cliente"))
{
%>
          <li><a class="current" href="Info.jsp">Servicios</a></li>
          <li><a href="Info.jsp">Paciente</a></li>
<%}%>
        </ul>
      </div>
    </div>
  </div>
  <div id="middle_box">
    <div class="middle_box_content"><img src="images/banner_content.jpg" alt="" /></div>
  </div>
     
 <%
asigMedico lista=(asigMedico) application.getAttribute("maestrar");
%>           
  <div id="main_content">
 
      <form  id ="datos" method="post" action="nuevoMedico.jsp" >     
          
     <%
     
if(request.getParameter("add") != null)
{
   if(!request.getParameter("nombrem").equalsIgnoreCase("") && !request.getParameter("tel").equalsIgnoreCase("")){
   Medico medico=new Medico();
   medico.addMedico(request.getParameter("nombrem"));
   medico.telefono=request.getParameter("tel");
   lista.medicos.add(medico); 
     }
}

if(request.getParameter("delete") != null)
{
    String nombre=request.getParameter("borrar");
    lista.eliminarMedico(nombre); 
}

%>
    <div class="box_content">
      <div class="box_title">
        <div class="title_icon"><img src="images/doctor.png" alt="" border="0" height="40" width="40"/></div>
        <h2>Lista de <span class="dark_blue">Medicos</span></h2>
      </div>
      <div class="box_text_content"> 
        
                  
                  <%
   for(Medico med:lista.medicos)
             {

%>
                  
                  
         <div class="box_text_content"> <img src="images/checked.gif" alt="" class="box_icon" />
          <div class="box_text"> <%out.print(med.nombre); %> </div>
        </div>
                  
               <%}%>

      </div>     
    </div>
         
          

          
    <div class="box_content">
      <div class="box_title">
        <div class="title_icon"><img src="images/add.png" alt="" border="0" height="32" width="32"/></div>
        <h2>Nuevo <span class="dark_blue"> Doctor</span></h2>
      </div>

     <div class="box_text_content"> 
        Nombre:
   
        <input type="text" name="nombrem" value="" size="15" />
         
      </div>
        
      <div class="box_text_content"> 
        Telefono:
   
        <input type="text" name="tel" value="" size="15" />
         
      </div>
        
        <div class="box_text_content" style="text-align:right"> 
    
        <input type="submit" value="Agregar" name="add" style=" background-color:#68C2EF; border-color:transparent" class="details"/>
      </div>
        
        
                 <BR>
                 <BR>
        

      <div class="box_title">
        <div class="title_icon"><img src="images/delete.png" alt="" /></div>
        <h2> Eliminar <span class="dark_blue">Doctor</span></h2>
      </div>
         
        <div class="box_text_content"> 
        
          <select name="borrar">
              <%

  for (Medico medicine : lista.medicos)  
{
%>
<option><% out.print(medicine.nombre); %></option>
              <%}%>
          </select>

      </div>
          
      <div class="box_text_content" style="text-align:right"> 
    
        <input type="submit" value="Eliminar" name="delete" style=" background-color:#68C2EF; border-color:transparent" class="details"/>
      </div>
         
     
        
        
        
    </div>
          
          
    
        <div class="box_content">
      <div class="box_title">
        <div class="title_icon"><img src="images/medical.png" alt="" border="0" height="32" width="32"/></div>
        <h2>Otros <span class="dark_blue">Enlaces</span></h2>
      </div>
      <div class="box_text_content"> <img src="" alt="" class="box_icon" />
        <div class="box_text"> Consulta de enfermedades y sus medicamentos. </div>
        <a href="Medicina.jsp" class="details">Enfermedades</a>
         </div>
            <%
if(usu.equalsIgnoreCase("admin"))
{     
%>
      <div class="box_text_content"> <img src="" alt="" class="box_icon" />
        <div class="box_text"> Rotaciones de los medicos en los diferentes centros. </div>
        <a href="Rotacion.jsp" class="details">Rotaciones</a> </div>
 <%}%>
    </div>
          
</form>

               
               
               
               
               
    <div class="clear"></div>
  </div>
          
  <div id="footer">
    <div class="copyright"> <img src="images/footer_logo.gif" alt="" /> </div>
    <div class="center_footer">&copy; Medical Clinic 2008. All Rights Reserved</div>
  
  </div>
</div>
    </body>
</html>
